inherited fmStaffDoc: TfmStaffDoc
  Left = 858
  Top = 230
  Width = 1013
  Height = 734
  Caption = #1059#1095#1077#1090' '#1076#1086#1082#1091#1084#1077#1085#1090#1086#1074' '#1089#1086#1090#1088#1091#1076#1085#1080#1082#1086#1074
  Constraints.MinHeight = 734
  Constraints.MinWidth = 1013
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 673
    Width = 1005
  end
  inherited Panel1: TPanel
    Width = 1005
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 835
    end
    inherited BitBtn2: TBitBtn
      Left = 923
    end
  end
  object Panel2: TPanel [2]
    Left = 0
    Top = 45
    Width = 1005
    Height = 628
    Align = alClient
    BevelInner = bvLowered
    TabOrder = 2
    object Panel5: TPanel
      Left = 533
      Top = 2
      Width = 470
      Height = 624
      Align = alClient
      BevelInner = bvLowered
      TabOrder = 0
      DesignSize = (
        470
        624)
      object Label1: TLabel
        Left = 5
        Top = 8
        Width = 223
        Height = 19
        Caption = #1053#1077#1086#1073#1093#1086#1076#1080#1084#1099#1077' '#1076#1086#1082#1091#1084#1077#1085#1090#1099':'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
      end
      object ToolBar3: TToolBar
        Left = 570
        Top = 9
        Width = 79
        Height = 33
        Align = alCustom
        AutoSize = True
        BorderWidth = 2
        EdgeInner = esNone
        EdgeOuter = esNone
        Images = DMInv.ilActive
        TabOrder = 0
        Transparent = True
      end
      object cxGrid1: TcxGrid
        Left = 5
        Top = 72
        Width = 457
        Height = 548
        Align = alCustom
        Anchors = [akLeft, akTop, akRight, akBottom]
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
        TabOrder = 1
        LookAndFeel.Kind = lfStandard
        object cxGridDBTableView1: TcxGridDBTableView
          NavigatorButtons.ConfirmDelete = False
          NavigatorButtons.First.Visible = True
          NavigatorButtons.PriorPage.Visible = True
          NavigatorButtons.Prior.Visible = True
          NavigatorButtons.Next.Visible = True
          NavigatorButtons.NextPage.Visible = True
          NavigatorButtons.Last.Visible = True
          NavigatorButtons.Insert.Visible = False
          NavigatorButtons.Append.Visible = False
          NavigatorButtons.Delete.Visible = False
          NavigatorButtons.Edit.Visible = False
          NavigatorButtons.Post.Visible = False
          NavigatorButtons.Cancel.Visible = False
          NavigatorButtons.Refresh.Visible = False
          NavigatorButtons.SaveBookmark.Visible = False
          NavigatorButtons.GotoBookmark.Visible = False
          NavigatorButtons.Filter.Visible = False
          FilterBox.Position = fpTop
          OnCellDblClick = cxGridDBTableView1CellDblClick
          OnCustomDrawCell = cxGridDBTableView1CustomDrawCell
          DataController.DataSource = dsDetSDDic
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <>
          DataController.Summary.SummaryGroups = <>
          FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
          NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
          OptionsBehavior.CellHints = True
          OptionsBehavior.IncSearch = True
          OptionsBehavior.IncSearchItem = cxGridDBTableView1SDNAMEDOC
          OptionsCustomize.ColumnGrouping = False
          OptionsData.CancelOnExit = False
          OptionsData.Deleting = False
          OptionsData.DeletingConfirmation = False
          OptionsData.Editing = False
          OptionsData.Inserting = False
          OptionsView.NavigatorOffset = 10
          OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
          OptionsView.CellAutoHeight = True
          OptionsView.CellTextMaxLineCount = 1
          OptionsView.ColumnAutoWidth = True
          OptionsView.GroupByBox = False
          OptionsView.Indicator = True
          OptionsView.ShowColumnFilterButtons = sfbAlways
          Preview.Visible = True
          Styles.IncSearch = DMInv.cxKrasniyText
          Styles.Selection = DMInv.cxJoltiyFon
          Styles.Header = DMInv.cxSiniyText
          object cxGridDBTableView1SDIDDOC: TcxGridDBColumn
            DataBinding.FieldName = 'SDIDDOC'
            Visible = False
            Width = 44
          end
          object cxGridDBTableView1SDNAMEDOC: TcxGridDBColumn
            Caption = #1053#1072#1080#1084#1077#1085#1086#1074#1072#1085#1080#1077' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
            DataBinding.FieldName = 'SDNAMEDOC'
            Options.Editing = False
            Options.Filtering = False
            Width = 271
          end
          object cxGridDBTableView1PD_DTYPE: TcxGridDBColumn
            Caption = #1042#1074#1077#1076#1077#1085
            DataBinding.FieldName = 'PD_DTYPE'
            PropertiesClassName = 'TcxCheckBoxProperties'
            Properties.ValueChecked = 1
            Properties.ValueUnchecked = 0
            Options.Editing = False
            Options.Filtering = False
            Options.Focusing = False
            Width = 64
          end
          object cxGridDBTableView1PND_SDID: TcxGridDBColumn
            Caption = #1053#1077#1086#1073#1093#1086#1076#1080#1084
            DataBinding.FieldName = 'PND_SDID'
            PropertiesClassName = 'TcxCheckBoxProperties'
            Properties.ValueChecked = 1
            Properties.ValueUnchecked = 0
            Options.Editing = False
            Options.Filtering = False
            Options.Focusing = False
            Width = 64
          end
          object cxGridDBTableView1SND2_SDID2: TcxGridDBColumn
            Caption = #1064#1072#1073#1083#1086#1085
            DataBinding.FieldName = 'SND2_SDID2'
            PropertiesClassName = 'TcxCheckBoxProperties'
            Properties.ValueChecked = 1
            Properties.ValueUnchecked = 0
            Visible = False
            Options.Editing = False
            Options.Focusing = False
            Width = 64
          end
          object cxGridDBTableView1Column1: TcxGridDBColumn
            DataBinding.FieldName = 'ERR'
            PropertiesClassName = 'TcxCheckBoxProperties'
            Properties.ReadOnly = True
            Properties.ValueChecked = 1
            Properties.ValueUnchecked = 0
            Visible = False
            Options.Editing = False
            Options.Filtering = False
            Options.Focusing = False
            IsCaptionAssigned = True
          end
        end
        object cxGridLevel1: TcxGridLevel
          GridView = cxGridDBTableView1
        end
      end
      object dxBarDockControl1: TdxBarDockControl
        Left = 6
        Top = 34
        Width = 456
        Height = 28
        Align = dalNone
        Anchors = [akLeft, akTop, akRight]
        BarManager = dxBarManager1
        SunkenBorder = True
        UseOwnSunkenBorder = True
      end
    end
    object Panel3: TPanel
      Left = 2
      Top = 2
      Width = 531
      Height = 624
      Align = alLeft
      BorderStyle = bsSingle
      ParentBackground = False
      TabOrder = 1
      object Label7: TLabel
        Left = 13
        Top = 8
        Width = 96
        Height = 19
        Caption = #1057#1086#1090#1088#1091#1076#1085#1080#1082':'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
      end
      object cxGrid4: TcxGrid
        Left = 5
        Top = 32
        Width = 516
        Height = 586
        Align = alCustom
        Anchors = [akLeft, akTop, akRight, akBottom]
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
        TabOrder = 0
        LookAndFeel.Kind = lfStandard
        OnFocusedViewChanged = cxGrid4FocusedViewChanged
        object cxGridDBTableView4: TcxGridDBTableView
          NavigatorButtons.ConfirmDelete = False
          NavigatorButtons.First.Visible = True
          NavigatorButtons.PriorPage.Visible = True
          NavigatorButtons.Prior.Visible = True
          NavigatorButtons.Next.Visible = True
          NavigatorButtons.NextPage.Visible = True
          NavigatorButtons.Last.Visible = True
          NavigatorButtons.Insert.Visible = False
          NavigatorButtons.Append.Visible = False
          NavigatorButtons.Delete.Visible = False
          NavigatorButtons.Edit.Visible = False
          NavigatorButtons.Post.Visible = False
          NavigatorButtons.Cancel.Visible = False
          NavigatorButtons.Refresh.Visible = False
          NavigatorButtons.SaveBookmark.Visible = False
          NavigatorButtons.GotoBookmark.Visible = False
          NavigatorButtons.Filter.Visible = False
          FilterBox.Position = fpTop
          OnCellDblClick = cxGridDBTableView4CellDblClick
          OnCustomDrawCell = cxGridDBTableView4CustomDrawCell
          OnFocusedRecordChanged = cxGridDBTableView4FocusedRecordChanged
          DataController.DataSource = dsSDDic
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <>
          DataController.Summary.SummaryGroups = <>
          FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
          NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
          OptionsBehavior.CellHints = True
          OptionsBehavior.IncSearch = True
          OptionsBehavior.IncSearchItem = cxGridDBTableView4PLASTNAME
          OptionsData.CancelOnExit = False
          OptionsData.Deleting = False
          OptionsData.DeletingConfirmation = False
          OptionsData.Editing = False
          OptionsData.Inserting = False
          OptionsView.NavigatorOffset = 10
          OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
          OptionsView.CellAutoHeight = True
          OptionsView.CellTextMaxLineCount = 1
          OptionsView.ColumnAutoWidth = True
          OptionsView.Indicator = True
          Preview.Visible = True
          Styles.IncSearch = DMInv.cxKrasniyText
          Styles.Selection = DMInv.cxJoltiyFon
          Styles.Header = DMInv.cxSiniyText
          object cxGridDBTableView4SDNAME: TcxGridDBColumn
            Caption = #1057#1090#1072#1090#1091#1089
            DataBinding.FieldName = 'SDNAME'
            Options.Editing = False
            Options.Filtering = False
            Width = 205
          end
          object cxGridDBTableView4PLASTNAME: TcxGridDBColumn
            Caption = #1060#1040#1052#1048#1051#1048#1071
            DataBinding.FieldName = 'FAM'
            Options.Editing = False
            Options.Filtering = False
            Width = 107
          end
          object cxGridDBTableView4PNAME: TcxGridDBColumn
            Caption = #1048#1052#1071
            DataBinding.FieldName = 'IM'
            Options.Editing = False
            Options.Filtering = False
            Width = 96
          end
          object cxGridDBTableView4PPATRONYMIC: TcxGridDBColumn
            Caption = #1054#1058#1063#1045#1057#1058#1042#1054
            DataBinding.FieldName = 'OT'
            Options.Editing = False
            Options.Filtering = False
            Width = 111
          end
          object cxGridDBTableView4Column2: TcxGridDBColumn
            Caption = #1044#1086#1083#1078#1085#1080#1082
            DataBinding.FieldName = 'ERR'
            PropertiesClassName = 'TcxCheckBoxProperties'
            Properties.ValueChecked = 1
            Properties.ValueUnchecked = 0
            Options.Editing = False
            Options.Filtering = False
            Options.Focusing = False
          end
        end
        object cxGridLevel3: TcxGridLevel
          GridView = cxGridDBTableView4
        end
      end
    end
  end
  inherited dlgDS: TDataSource
    Left = 8
    Top = 16
  end
  object dsSDDic: TDataSource
    DataSet = qSDDic
    Left = 144
    Top = 328
  end
  object qSDDic: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'select p.pid,p.plastname as fam,p.pname as im,p.ppatronymic as o' +
        't, sd.sdname,err2.pid,'
      '    iif(err2.pid is null, 0,1) as err, err2.err2'
      'from people p'
      '    inner join (select * from doljnost d'
      
        '        where (d.DOLISDELETE is null) and (d.doldatebegin <= CUR' +
        'RENT_DATE) and'
      
        '        ((d.doldateend >= CURRENT_DATE) or (d.doldateend is null' +
        '))) dol on dol.pid=p.pid'
      '    inner join sys_dic sd on sd.sdid=dol.sdid'
      
        '    left join (Select nd.*,iif(pd.dtype is null, 1,0) as err2, p' +
        'd.dtype'
      '        from (select PN.pid, PN.sdid'
      '            from p_needdoc pn'
      '            union'
      '            select ps.pid, sn.sdid2'
      '            from doljnost ps'
      '            inner join sys_needdoc sn on sn.sdid1 = ps.sdid'
      
        '            where (ps.DOLISDELETE is null) and (ps.doldatebegin ' +
        '<= CURRENT_DATE) and'
      
        '        ((ps.doldateend >= CURRENT_DATE) or (ps.doldateend is nu' +
        'll))'
      '            and not exists'
      '            ('
      '            select pn1.pid'
      '            from p_needdoc pn1'
      '            where pn1.pid = ps.pid'
      '            ) ) nd'
      
        '        left join (select * from p_documents where DISDELETE IS ' +
        'NULL) pd on nd.pid=pd.pid and nd.sdid=pd.dtype'
      '        where pd.dtype is null'
      '         ) err2 on err2.pid=p.pid'
      'where p.pisdelete is null'
      'group by p.pid,fam,im,ot,sd.sdname,err,err2.pid,err2.err2'
      'order by sdname,fam')
    GeneratorField.Field = 'SDID'
    Left = 176
    Top = 328
    object qSDDicPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qSDDicFAM: TIBStringField
      FieldName = 'FAM'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qSDDicIM: TIBStringField
      FieldName = 'IM'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qSDDicOT: TIBStringField
      FieldName = 'OT'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qSDDicSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSDDicERR: TIntegerField
      FieldName = 'ERR'
      ProviderFlags = []
    end
  end
  object quSDDIC: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  SCID'
      'from P_NEEDDOC '
      'where'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update P_NEEDDOC'
      'set'
      '  PID = :PID,'
      '  SCID = :SCID'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into P_NEEDDOC'
      '  (PID, SCID)'
      'values'
      '  (:PID, :SCID)')
    DeleteSQL.Strings = (
      'delete from P_NEEDDOC'
      'where'
      '  PID = :OLD_PID')
    Left = 672
    Top = 176
  end
  object dsDetSDDic: TDataSource
    DataSet = qDetSDDic
    Left = 608
    Top = 176
  end
  object qDetSDDic: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'select PD.DID, SND2.PID, SDD.*, iif(PD.DTYPE is null, 0, 1) as P' +
        'D_DTYPE, PND_CNT.PND_CNT, iif(PND_CNT >= 1,'
      '       (iif(PND.SDID is null, 0, 1)),'
      
        '       (iif(SND2.SDID2 is null, 0, 1))) as PND_SDID, iif(SND2.SD' +
        'ID2 is null, 0, 1) as SND2_SDID2,'
      
        '       iif(PND_CNT >= 1, iif((iif(PND.SDID is null, 0, 1)) <= (i' +
        'if(PD.DTYPE is null, 0, 1)), 0, 1), iif((iif(SND2.SDID2 is null,' +
        ' 0, 1)) <= (iif(PD.DTYPE is null, 0, 1)), 0, 1)) as ERR'
      'from (select OSN.SDID as SDIDDOC, SDNAME as SDNAMEDOC'
      '      from (select T1.SDPARID, T1.SDID, T1.SDNAME'
      
        '            from (with recursive TREE (SDNAME, SDID, SDPARID) as' +
        ' (select SD.SDNAME, SD.SDID, SD.SDPARID'
      
        '                                                                ' +
        '  from SYS_DIC SD'
      
        '                                                                ' +
        '  where SD.SDPARID = 2'
      
        '                                                                ' +
        '  union all'
      
        '                                                                ' +
        '  select SD1.SDNAME, SD1.SDID, SD1.SDPARID'
      
        '                                                                ' +
        '  from SYS_DIC SD1'
      
        '                                                                ' +
        '  inner join TREE T on T.SDID = SD1.SDPARID) select SDNAME,'
      
        '                                                                ' +
        '                                                    SDID,'
      
        '                                                                ' +
        '                                                    SDPARID'
      
        '                                                                ' +
        '                                             from TREE T) as T1)' +
        ' OSN'
      '      where not exists(select T1.SDPARID, T1.SDID, T1.SDNAME'
      
        '                       from (with recursive TREE (SDNAME, SDID, ' +
        'SDPARID) as (select SD.SDNAME, SD.SDID, SD.SDPARID'
      
        '                                                                ' +
        '             from SYS_DIC SD'
      
        '                                                                ' +
        '             where SD.SDPARID = OSN.SDID'
      
        '                                                                ' +
        '             union all'
      
        '                                                                ' +
        '             select SD1.SDNAME, SD1.SDID, SD1.SDPARID'
      
        '                                                                ' +
        '             from SYS_DIC SD1'
      
        '                                                                ' +
        '             inner join TREE T on T.SDID = SD1.SDPARID) select S' +
        'DNAME,'
      
        '                                                                ' +
        '                                                               S' +
        'DID,'
      
        '                                                                ' +
        '                                                               S' +
        'DPARID'
      
        '                                                                ' +
        '                                                        from TRE' +
        'E T) as T1)) SDD'
      'left join(select PID, DTYPE, DID'
      '          from P_DOCUMENTS'
      '          where PID = :PID and'
      '                DISDELETE is null) PD on PD.DTYPE = SDD.SDIDDOC'
      'left join(select PID, SDID'
      '          from P_NEEDDOC'
      '          where PID = :PID) PND on PND.SDID = SDD.SDIDDOC'
      'left join(select PID, SDID2'
      '          from DOLJNOST PS'
      '          left join(select *'
      '                    from SYS_NEEDDOC) SND on PS.SDID = SND.SDID1'
      '          where (PID = :PID) and'
      '                (PS.DOLISDELETE is null) and'
      '                (PS.DOLDATEBEGIN <= current_date) and'
      
        '                ((PS.DOLDATEEND >= current_date) or (PS.DOLDATEE' +
        'ND is null))'
      ''
      ') SND2 on SND2.SDID2 = SDD.SDIDDOC'
      'left join(select PID, count(*) as PND_CNT'
      '          from P_NEEDDOC'
      '          where PID = :PID'
      '          group by PID) PND_CNT on PND_CNT.PID > 0'
      
        'where iif(PND_CNT >= 1, (iif(PND.SDID is null, 0, 1)), (iif(SND2' +
        '.SDID2 is null, 0, 1))) = 1 or iif(PD.DTYPE is null, 0, 1) > 0  ' +
        ' ')
    UpdateObject = quSDDIC
    GeneratorField.Field = 'SDID'
    Left = 640
    Top = 176
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qDetSDDicDID: TIntegerField
      FieldName = 'DID'
      Origin = '"P_DOCUMENTS"."DID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qDetSDDicPID: TIntegerField
      FieldName = 'PID'
      Origin = '"DOLJNOST"."PID"'
    end
    object qDetSDDicSDIDDOC: TIntegerField
      FieldName = 'SDIDDOC'
      ProviderFlags = []
    end
    object qDetSDDicSDNAMEDOC: TIBStringField
      FieldName = 'SDNAMEDOC'
      ProviderFlags = []
      Size = 255
    end
    object qDetSDDicPD_DTYPE: TIntegerField
      FieldName = 'PD_DTYPE'
      ProviderFlags = []
    end
    object qDetSDDicPND_CNT: TIntegerField
      FieldName = 'PND_CNT'
      ProviderFlags = []
    end
    object qDetSDDicPND_SDID: TIntegerField
      FieldName = 'PND_SDID'
      ProviderFlags = []
    end
    object qDetSDDicSND2_SDID2: TIntegerField
      FieldName = 'SND2_SDID2'
      ProviderFlags = []
    end
    object qDetSDDicERR: TIntegerField
      FieldName = 'ERR'
      ProviderFlags = []
    end
  end
  object qDocuments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qDocumentsAfterInsert
    CachedUpdates = True
    DataSource = dsDetSDDic
    SQL.Strings = (
      
        'SELECT PD.*, SD.SDID, SD.SDNAME, IIF (DS.DSID IS NULL, 0, 1) AS ' +
        'ISSCAN, DS.DSIMAGE'
      'FROM P_DOCUMENTS PD'
      'INNER JOIN SYS_DIC SD ON SD.SDID = PD.DTYPE'
      'LEFT OUTER JOIN D_SCAN DS ON DS.DID = PD.DID'
      'WHERE PD.PID = :PID AND DTYPE=:sdiddoc'
      '        AND PD.DISDELETE IS NULL')
    UpdateObject = quDocuments
    GeneratorField.Field = 'DID'
    GeneratorField.Generator = 'GEN_P_DOCUMENTS'
    Left = 384
    Top = 360
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end
      item
        DataType = ftInteger
        Name = 'SDIDDOC'
        ParamType = ptUnknown
        Size = 4
      end>
    object qDocumentsDID: TIntegerField
      FieldName = 'DID'
      Origin = '"P_DOCUMENTS"."DID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qDocumentsPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_DOCUMENTS"."PID"'
      Required = True
    end
    object qDocumentsDMAINDOC: TIntegerField
      FieldName = 'DMAINDOC'
      Origin = '"P_DOCUMENTS"."DMAINDOC"'
    end
    object qDocumentsDTYPE: TIntegerField
      FieldName = 'DTYPE'
      Origin = '"P_DOCUMENTS"."DTYPE"'
    end
    object qDocumentsDSERIA: TIBStringField
      FieldName = 'DSERIA'
      Origin = '"P_DOCUMENTS"."DSERIA"'
      Size = 10
    end
    object qDocumentsDNUMBER: TIBStringField
      FieldName = 'DNUMBER'
      Origin = '"P_DOCUMENTS"."DNUMBER"'
    end
    object qDocumentsDFROMWHO: TIBStringField
      FieldName = 'DFROMWHO'
      Origin = '"P_DOCUMENTS"."DFROMWHO"'
      Size = 255
    end
    object qDocumentsDDATE: TDateField
      FieldName = 'DDATE'
      Origin = '"P_DOCUMENTS"."DDATE"'
    end
    object qDocumentsDNOTE: TIBStringField
      FieldName = 'DNOTE'
      Origin = '"P_DOCUMENTS"."DNOTE"'
      Size = 255
    end
    object qDocumentsDISDELETE: TIntegerField
      FieldName = 'DISDELETE'
      Origin = '"P_DOCUMENTS"."DISDELETE"'
    end
    object qDocumentsDUSERENTER: TIBStringField
      FieldName = 'DUSERENTER'
      Origin = '"P_DOCUMENTS"."DUSERENTER"'
      Size = 40
    end
    object qDocumentsDTIMEENTER: TDateTimeField
      FieldName = 'DTIMEENTER'
      Origin = '"P_DOCUMENTS"."DTIMEENTER"'
    end
    object qDocumentsDUSEREDIT: TIBStringField
      FieldName = 'DUSEREDIT'
      Origin = '"P_DOCUMENTS"."DUSEREDIT"'
      Size = 40
    end
    object qDocumentsDTIMEEDIT: TDateTimeField
      FieldName = 'DTIMEEDIT'
      Origin = '"P_DOCUMENTS"."DTIMEEDIT"'
    end
    object qDocumentsDOSN: TIntegerField
      FieldName = 'DOSN'
      Origin = '"P_DOCUMENTS"."DOSN"'
    end
    object qDocumentsSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"SYS_DIC"."SDID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qDocumentsSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qDocumentsISSCAN: TIntegerField
      FieldName = 'ISSCAN'
      ProviderFlags = []
    end
    object qDocumentsDSIMAGE: TBlobField
      FieldName = 'DSIMAGE'
      Origin = '"D_SCAN"."DSIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
  end
  object dsDocuments: TDataSource
    DataSet = qDocuments
    Left = 352
    Top = 360
  end
  object quDocuments: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  DID,'
      '  PID,'
      '  DMAINDOC,'
      '  DTYPE,'
      '  DSERIA,'
      '  DNUMBER,'
      '  DFROMWHO,'
      '  DDATE,'
      '  DNOTE,'
      '  DISDELETE,'
      '  DUSERENTER,'
      '  DTIMEENTER,'
      '  DUSEREDIT,'
      '  DTIMEEDIT,'
      '  DOSN,'
      '  SDID,'
      '  SDNAME,'
      '  ISSCAN,'
      '  DSIMAGE'
      'from P_DOCUMENTS '
      'where'
      '  DID = :DID')
    ModifySQL.Strings = (
      'update P_DOCUMENTS'
      'set'
      '  DDATE = :DDATE,'
      '  DFROMWHO = :DFROMWHO,'
      '  DID = :DID,'
      '  DISDELETE = :DISDELETE,'
      '  DMAINDOC = :DMAINDOC,'
      '  DNOTE = :DNOTE,'
      '  DNUMBER = :DNUMBER,'
      '  DOSN = :DOSN,'
      '  DSERIA = :DSERIA,'
      '  DTIMEEDIT = :DTIMEEDIT,'
      '  DTIMEENTER = :DTIMEENTER,'
      '  DTYPE = :DTYPE,'
      '  DUSEREDIT = :DUSEREDIT,'
      '  DUSERENTER = :DUSERENTER,'
      '  PID = :PID'
      'where'
      '  DID = :OLD_DID')
    InsertSQL.Strings = (
      'insert into P_DOCUMENTS'
      
        '  (DDATE, DFROMWHO, DID, DISDELETE, DMAINDOC, DNOTE, DNUMBER, DO' +
        'SN, DSERIA, '
      '   DTIMEEDIT, DTIMEENTER, DTYPE, DUSEREDIT, DUSERENTER, PID)'
      'values'
      
        '  (:DDATE, :DFROMWHO, :DID, :DISDELETE, :DMAINDOC, :DNOTE, :DNUM' +
        'BER, :DOSN, '
      
        '   :DSERIA, :DTIMEEDIT, :DTIMEENTER, :DTYPE, :DUSEREDIT, :DUSERE' +
        'NTER, :PID)')
    DeleteSQL.Strings = (
      'update P_DOCUMENTS'
      'set'
      '  DISDELETE = 1'
      'where'
      '  DID = :OLD_DID')
    Left = 416
    Top = 360
  end
  object dxBarManager1: TdxBarManager
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    Categories.Strings = (
      'Default')
    Categories.ItemsVisibles = (
      2)
    Categories.Visibles = (
      True)
    ImageOptions.Images = DMInv.cxSmallImages
    PopupMenuLinks = <>
    UseSystemFont = True
    Left = 306
    Top = 239
    DockControlHeights = (
      0
      0
      0
      0)
    object dxBarManager1Bar1: TdxBar
      AllowClose = False
      AllowCustomizing = False
      AllowQuickCustomizing = False
      AllowReset = False
      Caption = 'm1'
      CaptionButtons = <>
      DockControl = dxBarDockControl1
      DockedDockControl = dxBarDockControl1
      DockedLeft = 0
      DockedTop = 0
      FloatLeft = 205
      FloatTop = 165
      FloatClientWidth = 0
      FloatClientHeight = 0
      ItemLinks = <
        item
          Visible = True
          ItemName = 'dxBarButton1'
        end
        item
          Visible = True
          ItemName = 'dxBarButton2'
        end
        item
          Visible = True
          ItemName = 'dxBarButton3'
        end
        item
          Visible = True
          ItemName = 'dxBarButton4'
        end>
      NotDocking = [dsNone, dsLeft, dsTop, dsRight, dsBottom]
      OneOnRow = True
      Row = 0
      UseOwnFont = False
      UseRestSpace = True
      Visible = True
      WholeRow = False
    end
    object dxBarButton1: TdxBarButton
      Caption = 'New Button'
      Category = 0
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1076#1086#1082#1091#1084#1077#1085#1090
      Visible = ivAlways
      ImageIndex = 51
      OnClick = dxBarButton1Click
    end
    object dxBarButton2: TdxBarButton
      Caption = 'New Button'
      Category = 0
      Hint = 'New Button'
      Visible = ivAlways
      ImageIndex = 54
      OnClick = dxBarButton2Click
    end
    object dxBarButton3: TdxBarButton
      Caption = 'New Button'
      Category = 0
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1076#1086#1082#1091#1084#1077#1085#1090
      Visible = ivAlways
      ImageIndex = 46
      OnClick = dxBarButton3Click
    end
    object dxBarButton4: TdxBarButton
      Caption = 'New Button'
      Category = 0
      Hint = #1048#1079#1084#1077#1085#1080#1090#1100' '#1096#1072#1073#1083#1086#1085
      Visible = ivNever
      ImageIndex = 37
      OnClick = dxBarButton4Click
    end
  end
end
